/**
 * 
 */
package edu.gatech.cc.liam.core.rl.pomdp;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;

import edu.gatech.cc.liam.core.DiscreteDistribution;
import edu.gatech.cc.liam.core.rl.models.Action;
import edu.gatech.cc.liam.core.rl.models.stochasticgame.DiscreteActionTransitionFunction;

/**
 * @author liam
 *
 */
public class SingleAgentTransitionFunction<StateType> {
	
	DiscreteActionTransitionFunction<StateType> tF = new DiscreteActionTransitionFunction<StateType>();
	
	private static ArrayList<Action> surroundWithArray(Action a) {
		ArrayList<Action> r = new ArrayList<Action>();
		r.add(a);
		return r;
	}
	
	public void PutProb(StateType s1, Action a, StateType s2, Double d) {
		tF.PutProb(s1, surroundWithArray(a), s2, d);
	}
	
	public DiscreteDistribution<StateType> TransitionDistribution(StateType oldState, Action a) {
		return tF.TransitionDistribution(oldState, surroundWithArray(a));
	}
	
	public double TransitionProb(StateType oldState, Action a, StateType newState) {
		return tF.TransitionProb(oldState, surroundWithArray(a), newState);
	}
	
	public boolean ValidateAllProbs() {
		return tF.ValidateAllProbs();
	}
	
	public void normalizeAllProbs() {
		tF.normalizeAllProbs();
	}
	
	@Override
	public String toString() {
		return tF.toString();
	}
	public Set<StateType> getStates() {
		return tF.getStates();
	}
	public Set<ArrayList<Action>> getAllJointsForState(StateType state) {
		return tF.getAllJointsForState(state);
	}
	public int getNumberOfPlayers() {
		return tF.getNumberOfPlayers();
	}
	public ArrayList<HashSet<Action>> getActionSetsForState(StateType theState) {
		return tF.getActionSetsForState(theState);
	}
	public Set<StateType> getSuccessorStateSet(StateType theState, Action a) {
		return tF.getSuccessorStateSet(theState, surroundWithArray(a));
	}
	
}
